/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webaccess.retailws.Delegate;

import com.webaccess.retailws.Bean.MailBean;
import com.webaccess.retailws.Bean.UserAddressBean;
import com.webaccess.retailws.Bean.UserInfoBean;
import com.webaccess.retailws.DAO.UserInfoDAO;
import java.util.LinkedHashMap;

/**
 *
 * @author Abhishek Agrawal
 */
public class UserInfoDelegate {

    UserInfoDAO userDAO = null;

    public UserInfoDelegate() {
        userDAO = new UserInfoDAO();
    }

    public UserInfoBean getLoginPassword(String loginUsername) {
        return userDAO.getLoginPassword(loginUsername);
    }

    public String getPrefix(int prefixId) {
        return userDAO.getPrefix(prefixId);
    }

    public String getState(int stateId) {
        return userDAO.getState(stateId);
    }

    public Long insertUserInfo(UserInfoBean userInfoBeanObj, UserAddressBean[] userAddrBean) {
        return userDAO.insertUserInfo(userInfoBeanObj, userAddrBean);
    }

    public boolean checkEmail(String emailId) {
        return userDAO.checkEmail(emailId);
    }

    public boolean checkUsername(String username) {
        return userDAO.checkUsername(username);
    }

    public Long userLog(Long userLogStatusId, Long userId, String ipaddress) {
        return userDAO.userLog(userLogStatusId, userId, ipaddress);
    }

    public UserInfoBean getUserSecurityQuestion(String emailId) {
        return userDAO.getUserSecurityQuestion(emailId);
    }

    public boolean changePassword(Long userId, String encryptRandomPassword) {
        return userDAO.changePassword(userId, encryptRandomPassword);
    }

    public UserInfoBean getUserInfo(Long userId, Long roleId) {
        return userDAO.getUserInfo(userId, roleId);
    }

    public boolean checkPassword(Long userId, String currentPassword, Long roleId) {
        return userDAO.checkPassword(userId, currentPassword, roleId);
    }

    public UserAddressBean[] getUserAddress(Long userId) {
        return userDAO.getUserAddress(userId);
    }

    public UserAddressBean[] selectAddressByType(Long userId, int addressTypeId) {
        return userDAO.selectAddressByType(userId, addressTypeId);
    }

    public LinkedHashMap getTitleLHMap() {
        return userDAO.getTitleLHMap();
    }

    public LinkedHashMap getStateLHMap() {
        return userDAO.getStateLHMap();
    }

    public LinkedHashMap getSecurityQuestionLHMap() {
        return userDAO.getSecurityQuestionLHMap();
    }

    public boolean saveNewsletter(Long userId, int newsLetter) {
        return userDAO.saveNewsletter(userId, newsLetter);
    }

    public boolean saveAddress(Long addressId, UserAddressBean[] userAddrBeanList) {
        return userDAO.saveAddress(addressId, userAddrBeanList);
    }

    public boolean savePersonalInfo(Long userId, UserInfoBean userInfoBeanObj) {
        return userDAO.savePersonalInfo(userId, userInfoBeanObj);
    }

    public UserInfoBean[] getAllUsers(long roleId) {
        return userDAO.getAllUsers(roleId);
    }

    public boolean deleteUser(Long userId) {
        return userDAO.deleteUser(userId);
    }

    public UserInfoBean[] searchUserByFirstName(String searchUser) {
        return userDAO.searchUser(searchUser, "", "", 0L);
    }

    public UserInfoBean[] searchUserByLastName(String searchUser) {
        return userDAO.searchUser("", searchUser, "", 0L);
    }

    public UserInfoBean[] searchUserByEmail(String searchUser) {
        return userDAO.searchUser("", "", searchUser, 0L);
    }

    public UserInfoBean[] searchUserByStatusId(Long userStatusId) {
        return userDAO.searchUser("", "", "", userStatusId);
    }

    public UserInfoBean[] getRoles() {
        return userDAO.getRoles();
    }
}
